package com.whoru.app;

import com.whoru.beans.FiltroEstablecimiento;
import com.whoru.beans.Globals;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.CheckBox;

public class FiltroE extends Activity {
    /** Called when the activity is first created. */


    
    public void onCreate(Bundle savedInstanceState) {
    	super.onCreate(savedInstanceState);
    	setContentView(R.layout.efiltro);
    	
    }
    
    
    
    public void cargarDatos (View form){
    
    	//Recoger datos
    	
    	Globals appState = ((Globals)getApplicationContext());
        FiltroEstablecimiento e = appState.getFiltE();
    	
    	CheckBox Pub = (CheckBox) findViewById(R.id.checkpub);
    	CheckBox Restaurante = (CheckBox) findViewById(R.id.checkresta);
    	CheckBox Teatro = (CheckBox) findViewById(R.id.checkteatro);
    	CheckBox Deporte = (CheckBox) findViewById(R.id.checkdepor);
    	CheckBox Moda = (CheckBox) findViewById(R.id.checkmoda);
    	CheckBox Valorados = (CheckBox) findViewById(R.id.checkvalor);
    	
    	if (Deporte.isChecked())
    		e.setDeporte(true);
    	else
    		e.setDeporte(false);
    	
    	if (Pub.isChecked())
    		e.setPub(true);
    	else
    		e.setPub(false);
    	
    	if (Restaurante.isChecked())
    		e.setRestaurante(true);
    	else
    		e.setRestaurante(false);
    	
    	if (Moda.isChecked())
    		e.setModa(true);
    	else
    		e.setModa(false);
    	
    	if (Valorados.isChecked())
    		e.setValorados(true);
    	else
    		e.setValorados(false);
    	
    	if (Teatro.isChecked())
    		e.setTeatro(true);
    	else
    		e.setTeatro(false);

    	finish();
    	//Aqui hay que cargarlo a globales
    }
}